import { createRouter, createWebHashHistory } from "vue-router";


// 定义路由配置数组
const routes = [
    {  
        // 根路径
        path:"/",
        // 路由名称
        name:'main',
        // 异步加载 Main 组件
        component: ()=>import('@/views/Main.vue'),
        // 重定向到 /home 路径
        redirect:'/home',
        // 子路由配置
        children:[],
    },
    {
        path:"/login",
        name:"login",
        component:()=> import("@/views/Login.vue")
    },

        //也是一级路由
        {
          path: '/404',
          name: '404',
          component: () => import('@/views/404.vue')
        }
      
];





const router = createRouter({
    history:createWebHashHistory(),
    routes,
});

export default router;